//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_TIMER_H__
#define __ELASTOS_TIMER_H__

enum {
    PIT_ClockRate               = 3250000,                      // unit: HZ
    PIT_ClockCycle              = (1000000000 / PIT_ClockRate), // unit: NS
};

enum {
    PIT_Irq                     = 12,
};

// Registers' IO address
#define _TCFG0  ((ioport_t)0x91000000) //Timer 0 configuration
#define _TCFG1  ((ioport_t)0x91000004) //Timer 1 configuration
#define _TCON   ((ioport_t)0x91000008) //Timer control
#define _TCNTB0 ((ioport_t)0x9100000c) //Timer count buffer 0
#define _TCMPB0 ((ioport_t)0x91000010) //Timer compare buffer 0
#define _TCNTO0 ((ioport_t)0x91000014) //Timer count observation 0
#define _TCNTB1 ((ioport_t)0x91000018) //Timer count buffer 1
#define _TCMPB1 ((ioport_t)0x9100001c) //Timer compare buffer 1
#define _TCNTO1 ((ioport_t)0x91000020) //Timer count observation 1
#define _TCNTB2 ((ioport_t)0x91000024) //Timer count buffer 2
#define _TCMPB2 ((ioport_t)0x91000028) //Timer compare buffer 2
#define _TCNTO2 ((ioport_t)0x9100002c) //Timer count observation 2
#define _TCNTB3 ((ioport_t)0x91000030) //Timer count buffer 3
#define _TCMPB3 ((ioport_t)0x91000034) //Timer compare buffer 3
#define _TCNTO3 ((ioport_t)0x91000038) //Timer count observation 3
#define _TCNTB4 ((ioport_t)0x9100003c) //Timer count buffer 4
#define _TCNTO4 ((ioport_t)0x91000040) //Timer count observation 4

INLINE void EndOfPITInterrupt()
{
}

#endif // __ELASTOS_TIMER_H__
